/*    */ package com.qmsk.session;
/*    */ 
/*    */ import java.util.concurrent.ConcurrentHashMap;
/*    */ import javax.servlet.http.HttpSession;
/*    */ import javax.servlet.http.HttpSessionEvent;
/*    */ import javax.servlet.http.HttpSessionListener;
/*    */ 
/*    */ public class UserSessionListener
/*    */   implements HttpSessionListener
/*    */ {
/* 13 */   private static ConcurrentHashMap<String, HttpSession> user_map = new ConcurrentHashMap();
/*    */ 
/*    */   public static HttpSession addUser(String sId, HttpSession u) {
/* 16 */     return ((HttpSession)user_map.put(sId, u));
/*    */   }
/*    */ 
/*    */   public void sessionCreated(HttpSessionEvent hse)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void sessionDestroyed(HttpSessionEvent hse)
/*    */   {
/* 32 */     HttpSession session = hse.getSession();
/* 33 */     sessionRemove(session);
/*    */   }
/*    */ 
/*    */   private static void sessionRemove(HttpSession session) {
/* 37 */     if (session != null) {
/* 38 */       String sUserId = UserSessionInfo.user_getUserIdOfHttpSession(session);
/* 39 */       if ((sUserId != null) && (!(sUserId.equalsIgnoreCase(""))))
/* 40 */         user_map.remove(sUserId);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.session.UserSessionListener
 * JD-Core Version:    0.5.3
 */